package com.mccken.annotation.logoperator.extra;

import java.util.Optional;

/**
 * @program: mccken-collect
 * @description:
 * @author: mccken
 * @create: 2022-01-04 18:38
 **/
public class DefaultOperatorGetServiceImpl implements IOperatorGetService {
	@Override
	public Operator getUsers() {
		return Optional.ofNullable(UserUtils.getUser())
				.map(a -> new Operator(a.getName(), null, a.getLogin()))
				.orElseThrow(() -> new IllegalArgumentException("user is null"));
	}
}
